package com.advertise.login.action;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import com.advertise.login.model.LoginModel;

@Controller
public class LoginAction {

	@RequestMapping("login.action")
	public String login(@ModelAttribute("loginModel")
			LoginModel loginModel) {
		if(loginModel.getUserCode().equals(loginModel.getUserPass())) {
			return "main";
		} else {
			return "fail";
		}
	}
	@RequestMapping("logout.action")
	public String logout() {
		return "../index";
	}
	
	
	@RequestMapping("goTopPage.action")
	public String goTopPage() {
		return "top";
	}
	
	@RequestMapping("goLeftTitlePage.action")
	public String goLeftTitlePage() {
		return "left_title";
	}
	
	@RequestMapping("goLeftPage.action")
	public String goLeftPage() {
		return "left";
	}
	
	@RequestMapping("goWorkTitlePage.action")
	public String goWorkTitlePage() {
		return "work_title";
	}
	
	@RequestMapping("goWorkPage.action")
	public String goWorkPage() {
		return "work";
	}
	
	@RequestMapping("goBottomPage.action")
	public String goBottomPage() {
		return "bottom";
	}
	
}
